<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
    <meta name="description" content="壹果Yiigoo，致力创造对婴童更呵护、更舒服、更安心安全的产品，重新定义“互联网+”专业婴童品牌。">
    <meta name="keywords" content="壹果,yiigoo,壹果企画,壹果企画（北京）科技有限公司,母婴,婴童,爬服">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="format-detection" content="telephone=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" /> 
    <link rel="stylesheet" type="text/css" href="https://m.yiigoo.com/css/base.css?v=45a13f69c0">
    <link rel="stylesheet" type="text/css" href="https://m.yiigoo.com/css/yiigoo.css?v=20170322"> 
    <link rel="stylesheet" type="text/css" href="https://m.yiigoo.com/css/zt.css?v=${version}">
    
    <title>${ygPages.pageTitle}</title>
</head>
<body>

<div id="yg-doc">
    <div id="yg-bd">       
        
            <div class="zt-template">   

            <#assign text>
		      ygPages.pageContent
            

            </#assign>

            <#assign json=ygPages.pageContent?eval />

            <#list json as item>

             <#if item.type=="banner">
	             <div class="zt-col-${item.amount}">
	               <ul>
	               <#list item.productList as t>
	                <#if t.productId!=" ">
	                <li><a onclick="gotoDetail('Banner','${t.productId}')"><img src="${t.imagePath}" alt=""></a></li>
	                <#else>
	                <li><img src="${t.imagePath}" alt=""></li>
	                </#if>
	               </#list>
	               </ul>
	            </div>
              
              </#if>
              <#if item.type=="category">
				
              <div class="zt-col-${item.amount}">
                 <ul>      
                  <#list item.productList as t>   
                  <#if t.linkUrl!="">
                  <li onclick="gotoDetail('Category','${t.linkUrl}')"><img src="${t.imagePath}" alt=""></li>
                  <#else>
                  <li><img src="${t.imagePath}" alt=""></li>
                  </#if>        
                
                 </#list>                
                 </ul>
               
              </div>
              </#if>
            <#if item.type=="coupon">
                <#if item.amount=="5">               
                 
                    <div class="zt-col-1">
                     <ul>
                     <#list item.couponList as t>
                      <li  class="gift"><img src="${t.imagePath}" alt=""></li>
                     </#list>
                     </ul>
                </div>
                <#elseif item.amount=="6"> 
             		<div class="zt-col-1">
                     <ul>
                     <#list item.couponList as t>
                      <li  class="tryProduct"><img src="${t.imagePath}" alt=""></li>
                     </#list>
                     </ul>
                </div>
              <#else>
                  <div class="zt-col-${item.amount}">
                     <ul>
                     <#list item.couponList as t>
                      <li onclick="gotoDetail('Coupon','${t.batchId}')" class="coupon"><img src="${t.imagePath}" alt=""></li>
                     </#list>
                     </ul>
                  </div>
              </#if>
            </#if>
               <#if item.type=="product">
                  
              <div class="zt-col-${item.amount}">
                 <ul>
                 <#list item.productList as t>
                  <li onclick="gotoDetail('Product','${t.productId}')"><img src="${t.imagePath}" alt=""></li>
                 </#list>
                 </ul>
              </div>
              </#if>         

            </#list>
            
            
            <footer id="yg-fd"><div class="fd-bar"><nav class="fd-nav"><a style="width:25%" onclick="gotoMenu('Home')" href="javascript:void(0);"><i class="h"></i><p>首页</p></a><a href="javascript:void(0);" onclick="gotoMenu('Group')" style="width:25%"><i class="l"></i><p>拼团</p></a><a href="javascript:void(0);" onclick="gotoMenu('Car')" style="width:25%"><i class="c"></i><p>购物车</p></a><a onclick="gotoMenu('Me')" href="javascript:void(0);" style="width:25%"><i class="w"></i><p>我的</p></a></nav></div></footer>
            </div>
             
 </div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
<script type="text/javascript">  
var code=document.location.search;
function gotoDetail(type,id){
  if(type=="Product")
   wx.miniProgram.navigateTo({url: "/pages/goods/detail/detail?id="+id});
  if(type=="Coupon")
   {
    var linkUrl="/pages/coupon/coupon?id="+id+"&backUrl="+encodeURI(window.location.href);
    wx.miniProgram.navigateTo({url:linkUrl});
   
   }
   if(type=="Banner"){
    if(id.indexOf("product/list.html?key")>1){
	   	var key=id.replace("http://m.yiigoo.com/product/list.html?key=","");
	     wx.miniProgram.navigateTo({url: "/pages/goods/list/list?key="+decodeURI(key)});
     }else if(id.indexOf("group")>1){
     	wx.miniProgram.navigateTo({url: "/pages/goods/group/group"});
     }else if(id.indexOf("product/product")>1){
       var productId=id.replace("http://m.yiigoo.com/product/product.html?productId=","")
     	wx.miniProgram.navigateTo({url: "/pages/goods/detail/detail?id="+productId});
     }else if(id.indexOf("product/list.html?cname")>1){
        var i=id.indexOf("?");
     wx.miniProgram.navigateTo({url: "/pages/goods/list/list"+decodeURI(id.substring(i))});
     }else if(id.indexOf("promotion")>1){
     	wx.miniProgram.navigateTo({url: "/pages/index/index"});
     }else if(id.indexOf("channel/yiPlan.html")>1){
       wx.miniProgram.navigateTo({url: "/pages/vip/beVip/beVip"+decodeURIComponent(code)});
     }else if(id.indexOf("soapshare.html")>1){
       wx.miniProgram.navigateTo({url: "/pages/promotion/soapShare/soapShare"});
     }else if(id.indexOf("seconds.html")>1){
       wx.miniProgram.navigateTo({url: "/pages/goods/seconds/seconds"});
     }else{
       wx.miniProgram.navigateTo({url: "/pages/webview/webview?url="+decodeURI(id)});
     }
   }
}
function gotoMenu(type){
var linkUrl="";
switch(type){
	case "Home":
	linkUrl="/pages/index/index";
	break;
	case "Group":
	linkUrl="/pages/goods/group/group";
	break;
	case "Car":
	linkUrl="/pages/car/car/index";
	break;
	case "Me":
	linkUrl="/pages/user/index/index";
	break;
}
wx.miniProgram.navigateTo({url: linkUrl});
}
function wxrequest(url,postData,doSuccess){
    var version = "2.1.1";
    var date = new Date();
    var param = "jQuery" + (version + Math.random()).replace(/\D/g, "") + "_" + date.getTime();
   
     url += "?" + "callback=" + param;
    var header = { 'content-type': 'application/x-www-form-urlencoded', 'Cookie': 'JSESSIONID=' + wx.getStorageSync('JSESSIONID') }

    wx.request({
      url: __config.HTTP_BASE_URL + url,
      data: postData,
      method: method,
      header: header,
      success: function (res) {        
         var data = res.data;
        data = data.replace(param + "(", "");
        data = data.substr(0, data.length - 1);
        data = JSON.parse(data)
        if (data.type == "error") {
          if (data.extra != null && data.extra.key == "REDIRECT_LONGIN_PAGE") {
             //wx.miniProgram.navigateTo({url: "/pages/webview/webview?url="+decodeURI(id)});
          } else {
			 showTitle(data.content);
            
          }

          //跳转到上一个页面

        } else if (data.type == "success" && typeof doSuccess == "function") {
          doSuccess(data.extra);
        } else {
           showTitle(data.content);
        }
      },
      fail: function () {
        
        showTitle("系统错误请重试");

      },
      complete: function () {
      }
    });
    }
    function showTitle(msg){
        wx.showToast({
			  title: msg,
			  icon: 'success',
			  duration: 2000
			})
    }

</script>

</body>
</html>